import domain from 'ad-ui-domain'
import createReducer from 'ad-ui-reducer'
import Cookies from 'cookies-js'
import { LANG } from 'cache'

const Model = 'Map'
const Config = {
  changeLang: (enitity: any, response: string) => {
    Cookies.set(LANG, response, { domain: __COOKIE_DOMAIN__ })
    return enitity = domain.create(Model, { lang: response })
  },
}

export default createReducer(Model, Config)
